package cn.iocoder.yudao.module.nginxui.dal.mysql.eventsconfig;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.nginxui.dal.dataobject.eventsconfig.EventsConfigDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.nginxui.controller.admin.eventsconfig.vo.*;

/**
 * Nginx events块配置 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface EventsConfigMapper extends BaseMapperX<EventsConfigDO> {

    default PageResult<EventsConfigDO> selectPage(EventsConfigPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<EventsConfigDO>()
                .eqIfPresent(EventsConfigDO::getConfigId, reqVO.getConfigId())
                .eqIfPresent(EventsConfigDO::getWorkerConnections, reqVO.getWorkerConnections())
                .eqIfPresent(EventsConfigDO::getEventModel, reqVO.getEventModel())
                .eqIfPresent(EventsConfigDO::getMultiAccept, reqVO.getMultiAccept())
                .eqIfPresent(EventsConfigDO::getAcceptMutex, reqVO.getAcceptMutex())
                .eqIfPresent(EventsConfigDO::getAcceptMutexDelay, reqVO.getAcceptMutexDelay())
                .eqIfPresent(EventsConfigDO::getStatus, reqVO.getStatus())
                .betweenIfPresent(EventsConfigDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(EventsConfigDO::getId));
    }

}